/**
 * 
 */
package org.dcarew.notification.ui;

import org.dcarew.notification.NotificationPlugin;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;

// Chrome uses a larger icon (26x26, buttons left aligned, a gradient for the
// background, and a blueish background.

// TODO: create an undecorated icon button

/**
 * 
 * 
 * 
 */
public class NotificationControl extends Composite {
  private CLabel label;
  
  public NotificationControl(Composite parent, int style) {
    super(parent, style | SWT.BORDER);
    
    GridLayoutFactory.fillDefaults().margins(2, 1).
      extendedMargins(0, 1, 0, 0).numColumns(3).applyTo(this);
    
    // TODO: cache -
    Color bkColor = new Color(Display.getDefault(), 0xff, 0xff, 0xe1);
    
    setBackground(bkColor);
    
    label = new CLabel(this, SWT.NONE);
    label.setImage(NotificationPlugin.getImage("icons/sample_alert.png"));
    label.setText("Lorem ipsum dolor sit ame elit, sed do eiusmod tempor.");
    label.setFont(JFaceResources.getDialogFont());
    label.setBackground(bkColor);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(label);
    
    Composite buttonComposite = new Composite(this, SWT.NO_BACKGROUND);
    GridDataFactory.swtDefaults().applyTo(buttonComposite);
    GridLayoutFactory.fillDefaults().numColumns(2).applyTo(buttonComposite);
    
    Button button1 = new Button(buttonComposite, SWT.PUSH);
    button1.setText("Apply Changes");
    
    Button button2 = new Button(buttonComposite, SWT.PUSH);
    button2.setText("Bird Internet");
    
    Label closeButton = new Label(this, SWT.NONE);
    GridDataFactory.swtDefaults().applyTo(closeButton);
    closeButton.setImage(NotificationPlugin.getImage("icons/remove_d.gif"));
  }

}
